package bancosys.tec.persist.entities.dao;

import java.util.List;

import bancosys.tec.persist.dao.BaseDAO;
import bancosys.tec.persist.dao.BeanNotFoundException;
import bancosys.tec.persist.entities.domain.EntityWithNamedQueries;

public class EntityWithNamedQueriesDAO extends BaseDAO<EntityWithNamedQueries> {

    public List<EntityWithNamedQueries> findWithName(String name) {
        return this.executeNamedQuery("withName", name);
    }

    public EntityWithNamedQueries findOneWithName(String name) throws BeanNotFoundException {
        return this.executeSingleNamedQuery("withName", name);
    }

    public void updateName(String oldName, String newName) {
        this.executeNamedQueryUpdate("updateName", newName, oldName);
    }

    public void deleteWithName(String name) {
        this.executeNamedQueryUpdate("deleteWithName", name);
    }

    public List<EntityWithNamedQueries> hotFindWithName(String name) {
        return this.executeHotNamedQuery("withName", name);
    }

}
